package com.qufadai.reader.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.qufadai.reader.entity.User;
import com.qufadai.reader.repository.UserRepository;

@Service
public class UserService {

	@Resource
	private UserRepository userRepository;

	public void saveUser(User user) {
		userRepository.save(user);
	}

	public User findUserById(Integer id) {
		System.out.println("Service->findUserById");
		return this.userRepository.findOne(id);
	}

	public void updateUser(User user) {
		this.userRepository.save(user);
	}

	public void deleteUserById(Integer id) {
		this.userRepository.delete(id);
	}
}
